﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExportToExcel.aspx.cs" Inherits="ZX.TR.Web.ExportToExcel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>导出EXCEL</title>
<style type="text/css">
    BODY,TD {background-color:#ffffff;font-size: 9pt; color: #000000;}
    .pagetitle{ font-family: 宋体; font-size: 10pt; color:#000000; font-weight:bold;}
    p{ font-family: 宋体; font-size: 10pt; color:#ff3333; font-weight:bold;}
    div{ font-family: 宋体; font-size: 9pt; color: #000000}
    td{border: solid; border-width: .5pt .5pt .5pt .5pt; border-color: #003366 #003366 #003366 #003366}     
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="Report_div">
        <table align="center" class="tableContent Header">
            <tr>
                <td align="right" width="70px">
                    问卷名称：
                </td>
                <td align="left" width="400px">
                    <asp:Label ID="lblQname" runat="server"></asp:Label>
                </td>
                <td align="right" width="75px">
                    发起部门：
                </td>
                <td align="left" width="100px">
                    <asp:Label ID="lblQtype" runat="server"></asp:Label>
                </td>
                <td align="right" width="95px">
                    参与调查人数：
                </td>
                <td align="left" width="75px" title="参与网上调研的总人数">
                    <asp:Label ID="lbltotalPeopleNum" runat="server"></asp:Label>
                </td>
                <td align="right" width="95px">
                    有效问卷份数：
                </td>
                <td align="left" width="75px" title="完整地回答完所有问题的参与调研中人数">
                    <asp:Label ID="lblEffectivetotalPeopleNum" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
        <br />
        <asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
            <HeaderTemplate>
            </HeaderTemplate>
            <ItemTemplate>
                <table class="tableContent">
                    <tr>
                        <td style="text-align: right; width: 75px;">
                            <asp:HiddenField ID="TrSubjectInfoID" runat="server" Value='<%#Eval("TrSubjectInfoID")%>'>
                            </asp:HiddenField>
                            <asp:HiddenField ID="TrQuestionnaireSubjectID" runat="server" Value='<%#Eval("TrQuestionnaireSubjectID")%>'>
                            </asp:HiddenField>
                            题目内容：
                        </td>
                        <td style="text-align: left;">
                            <%#Eval("sequence") %>.<%#Eval("SubjectContent")%>
                            【
                            <asp:Label ID="lblType" runat="server" Text='<%#Eval("SubjectType")%>'></asp:Label>
                            】
                            <asp:HyperLink ID="lnkOpen" runat="server" NavigateUrl="" Target="_blank" Visible="false">查看调研结果</asp:HyperLink>
                        </td>
                    </tr>
                    <tr style='display: <%#((Eval("SubjectType").ToString()=="单选题")||(Eval("SubjectType").ToString()=="多选题"))?"":"none"%>'>
                        <td style="text-align: right">
                            选项内容：
                        </td>
                        <td style="text-align: left">
                            <asp:Repeater ID="rptItem" runat="server">
                                <HeaderTemplate>
                                    <table width="99%">
                                        <tr>
                                            <td>
                                                选项
                                            </td>
                                            <td style="text-align: left; width: 450px;">
                                                内容
                                            </td>
                                            <td>
                                                小计
                                            </td>
                                            <td>
                                                比例
                                            </td>
                                        </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <%#Eval("ItemCode")%>
                                        </td>
                                        <td>
                                            <%#Eval("SunjectItem")%>
                                        </td>
                                        <td>
                                            <%#Eval("totalCount")%>
                                        </td>
                                        <td>
                                            <%#Eval("EffectivePercent")%>%
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                    <tr style='display: <%#((Eval("SubjectType").ToString()=="判断题"))?"":"none"%>'>
                        <td style="text-align: right">
                            选项内容：
                        </td>
                        <td style="text-align: left">
                            <table width="99%">
                                <tr>
                                    <td>
                                        选项
                                    </td>
                                    <td>
                                        小计
                                    </td>
                                    <td>
                                        比例
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        对
                                    </td>
                                    <td>
                                        <%# GetCount(Eval("TrSubjectInfoID").ToString(),"对")%>
                                    </td>
                                    <td>
                                        <%# GetCountPercent(Eval("TrSubjectInfoID").ToString(), "对")%>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        错
                                    </td>
                                    <td>
                                        <%# GetCount(Eval("TrSubjectInfoID").ToString(), "错")%>
                                    </td>
                                    <td>
                                        <%# GetCountPercent(Eval("TrSubjectInfoID").ToString(), "错")%>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr style='display: <%#((Eval("SubjectType").ToString()=="填空题"))?"":"none"%>'>
                        <td style="text-align: left" colspan="2">
                            <asp:Repeater ID="rptEssayQuestionItem" runat="server" >
                                <HeaderTemplate>
                                    <table width="99%">
                                        <tr>
                                            <td style="text-align: left;width:50px;"> 序号</td>
                                            <td style="text-align: left;width:450px;" colspan="3">答案</td>
                                        </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td> 
                                        <%#Eval("RowNum")%>
                                        </td>
                                        <td colspan="3"> <%#Eval("Answer")%></td>
                                    </tr>                         
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="border:0">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
            <FooterTemplate>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>
